package cn.store.utils;


import redis.clients.jedis.*;


public class JedisUtils {
	//创建连接池
	private static JedisPoolConfig config;
	private static JedisPool pool;
	static{
		config=new JedisPoolConfig();
		config.setMaxTotal(30);
		config.setMaxIdle(2);
		pool=new JedisPool(config, "liulingjie.cn", 6379,10000,"LLJ-Redis");

	}
	//获取连接的方法
	public static Jedis getJedis(){
		return pool.getResource();
	}
	//释放连接
	public static void closeJedis(Jedis j){
		j.close();
	}
	public static void main(String [] args){
		new JedisUtils();
	}
}
